#ifndef MODEL_HY
#define MODEL_HY


#include "gLib.h"

class CTriangle;
class CEngine;
class CGraphics;

class CModel
{
private:
	int m_vertexNum;
	int m_faceNum;
	unsigned int m_color;
	gVertex3D *m_vOriginalBuffer;
	gVertex3D *m_vTransformedBuffer;
	gVertex3D::VertexState *m_vertexState;
	CTriangleIndex *m_faces;

	CEngine *m_engine;
	CGraphics *m_g;

public:
	int m_centerPosX;
	int m_centerPosY;
	int m_centerPosZ;

	int m_rotateX;
	int m_rotateY;
	int m_rotateZ;

	int m_scaleX;
	int m_scaleY;
	int m_scaleZ;

	CModel(CEngine *engine, int vertexNum, gVertex3D *buff, int faceNum, int index[][3]);
	~CModel();
	void SetColor(unsigned char r, unsigned char g, unsigned char b);
	void SetPos(int x, int y, int z);
	void TranslateToWorldCoord();
	void TranslateToCameraCoord();
	void InsertToRenderList();
	void TestObjVisibale();
	void TestFaceVisibale();
	void ResetVertex();
};

#endif